<?php
/**
 * The factories menu
 *
 * Copyright (C) 2008  Sean Hickey
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Sean Hickey <sean@headzoo.com>
 * @version $Id: Factories.php 394 2008-07-03 05:49:00Z sean $
 */
?>
<div class="wrap">
	<h2>Factories</h2>
	<?php echo Alinks_Popup::show(Alinks_Popup::KEY_FACTORIES); ?>
	<form method="post" enctype="multipart/form-data">
		<input type="hidden" name="<?php echo Alinks_Form::FORM_ALINKS; ?>" value="upload" />
		<?php wp_nonce_field(Alinks_Form::NONCE_ACTION); ?>
		<fieldset class="<?php echo Alinks_Form::CLASS_FIELDSET_FACTORIES; ?>">
			<legend>Install</legend>
			<p>You can install a new factory by uploading it's ZIP file with the form below.</p>
			<ul class="<?php echo Alinks_Form::CLASS_FORM; ?>">
				<li>
					<label for="alinks_upload">Select ZIP File: </label>
					<input type="file" id="alinks_upload" name="file" />
					<div><small>Factories come packaged in .zip files. Select the zip file and click the upload button to install.</small></div>
				</li>
			</ul>
			<div class="submit">
				<input type="submit" value="Upload &raquo;" />
			</div>
		</fieldset>
	</form>
	<p>The following factories are installed and active.</p>
		<?php include('AlinksMenus/Factories/TableHead.php'); ?>
		<tbody>
			<?php foreach($d_factories as $factory) {
				$active = true;
				include('AlinksMenus/Factories/Factory.php');
			} ?>
		</tbody>
	</table>
	<?php if (count($d_incompatibles) > 0) : ?>
		<p>The following factories are installed, but are incompatible with this version of aLinks or WordPress. They have been deactivated.</p>
			<?php include('AlinksMenus/Factories/TableHead.php'); ?>
			<tbody>
				<?php foreach($d_incompatibles as $factory) {
					$active = false;
					include('AlinksMenus/Factories/Factory.php');
				} ?>
			</tbody>
		</table>
	<?php endif; ?>
</div>